package com.atgui.java21_1_19;

/*
 * 测试类
 */
public class GeometricTest {
	public static void main(String[] args) {
		GeometricTest Test = new GeometricTest();
		Circle c1 = new Circle(3.2, "red", 1.0);
		Circle c2 = new Circle(3.2, "red", 1.0);

		boolean isEquals = Test.isEquals(c1, c2);
		System.out.println("两个图形面积是否相等：" + isEquals);
		System.out.println("图形面积为：" + Test.displayGeometricObject(c1));

		System.out.println("***************");
		MyRectangle m = new MyRectangle(2.3, 1.6, "yellow", 2.0);
		double ares = Test.displayGeometricObject(m);
		System.out.println("图形的面积为：" + ares);
	}

	public boolean isEquals(GeometricObject o1, GeometricObject o2) {
		return o1.findAres() == o2.findAres();
	}

	public double displayGeometricObject(GeometricObject o) {
		return o.findAres();

	}
}
